//
//  GreenHandGuideViewController.m
//  Yihubang
//
//  Created by hyu on 16/9/27.
//  Copyright © 2016年 jinghao. All rights reserved.
//

#import "GreenHandGuideViewController.h"

#define GUARDIMAGEARRCOUNT 4         //设置定时守护图片个数
#define URGENTIMAGEARRCOUNT 4        //设置一键紧急图片个数
#define MAPIMAGEARRCOUNT 3           //设置实时地图图片个数

@interface GreenHandGuideViewController ()
@property (nonatomic,strong)NSMutableArray *guardImageArr;
@property (nonatomic,strong)NSMutableArray *urgentImageArr;
@property (nonatomic,strong)NSMutableArray *mapImageArr;
@end

@implementation GreenHandGuideViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"新手指南";
    self.showLeftMenu =YES;
    @weakify(self);
    [self.guardImage setTapActionWithBlock:^(UIGestureRecognizer *gestureRecoginzer) {
        @strongify(self);
        [self pushWithImageArr:self.guardImageArr];
    }];
    [self.urgentImage setTapActionWithBlock:^(UIGestureRecognizer *gestureRecoginzer) {
        @strongify(self);
        [self pushWithImageArr:self.urgentImageArr];
    }];
    [self.mapImage setTapActionWithBlock:^(UIGestureRecognizer *gestureRecoginzer) {
        @strongify(self);
        [self pushWithImageArr:self.mapImageArr];
    }];
    // Do any additional setup after loading the view.
}

- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)pushWithImageArr:(NSMutableArray*)arr{
    UIStoryboard *story = [UIStoryboard storyboardWithName:@"Mine" bundle:[NSBundle mainBundle]];
    UIViewController *vct = [story instantiateViewControllerWithIdentifier:@"UserGuideViewController"];
    vct.params = @{@"imageArr":arr};
    [self pushViewController:vct animated:YES];
}

- (NSMutableArray *)guardImageArr{
    if (!_guardImageArr) {
        _guardImageArr = [NSMutableArray array];
        for (int i = 0; i < GUARDIMAGEARRCOUNT; i ++) {
            UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"guardImage%d",i]];
            [_guardImageArr addObject:image];
        }
    }
    return _guardImageArr;
}

- (NSMutableArray *)urgentImageArr{
    if (!_urgentImageArr) {
        _urgentImageArr = [NSMutableArray array];
        for (int i = 0; i < URGENTIMAGEARRCOUNT; i ++) {
            UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"urgentImage%d",i]];
            [_urgentImageArr addObject:image];
        }
    }
    return _urgentImageArr;
}

- (NSMutableArray *)mapImageArr{
    if (!_mapImageArr) {
        _mapImageArr = [NSMutableArray array];
        for (int i = 0; i < MAPIMAGEARRCOUNT; i ++) {
            UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"mapImage%d",i]];
            [_mapImageArr addObject:image];
        }
    }
    return _mapImageArr;
}


/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
